package com.app.TCES.controller;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.app.TCES.domain.Test;
import com.app.TCES.service.A_e1Service;

@Controller
public class A_e1Controller {

	Logger log = LogManager.getLogger(A_e1Controller.class);

	@Autowired
	A_e1Service a_e1Service;

	// 查找教师同行评价内容
	@ResponseBody
	@RequestMapping("/selectE_Teacher")
	public Map<String, Object> selectE_Teacher() {

		Map<String, Object> map = new HashMap<String, Object>();
		List<Test> list = a_e1Service.selEvaluations1();

		map.put("tol", 10);
		map.put("message", "教师同行评价内容查询成功");
		map.put("status", 200);
		map.put("list", list);
		return map;
	}

	// 查找学生评价内容
	@ResponseBody
	@RequestMapping("/selectE_student")
	public Map<String, Object> selectE_student() {

		Map<String, Object> map = new HashMap<String, Object>();
		List<Test> list = a_e1Service.selEvaluations2();

		map.put("tol", 10);
		map.put("message", "查找学生评价内容查询成功");
		map.put("status", 200);
		map.put("list", list);
		return map;
	}

	// 更新评价表
	@ResponseBody
	@RequestMapping("/updateEva")
	public Map<String , String> updateEva(int testId,String testContent){
		
		log.debug("开始修改");
		log.debug(testId+testContent);
		a_e1Service.UpdateEva(testId, testContent);
		Map<String, String> map =new HashMap<String, String>();
		map.put("msg", "YES");
		return map;
		
	}
	
	
}
